.class final Lorg/zeam/Utilities;
.super Ljava/lang/Object;
.source "Utilities.java"


# static fields
.field private static final sBounds:Landroid/graphics/Rect;

.field private static sCanvas:Landroid/graphics/Canvas;

.field private static sIconHeight:I

.field private static sIconWidth:I

.field private static final sOldBounds:Landroid/graphics/Rect;

.field private static final sPaint:Landroid/graphics/Paint;


# direct methods
.method static constructor <clinit>()V
    .locals 4

    .prologue
    const/4 v0, -0x1

    .line 28
    sput v0, Lorg/zeam/Utilities;->sIconWidth:I

    .line 29
    sput v0, Lorg/zeam/Utilities;->sIconHeight:I

    .line 31
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    sput-object v0, Lorg/zeam/Utilities;->sPaint:Landroid/graphics/Paint;

    .line 32
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    sput-object v0, Lorg/zeam/Utilities;->sBounds:Landroid/graphics/Rect;

    .line 33
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    sput-object v0, Lorg/zeam/Utilities;->sOldBounds:Landroid/graphics/Rect;

    .line 34
    new-instance v0, Landroid/graphics/Canvas;

    invoke-direct {v0}, Landroid/graphics/Canvas;-><init>()V

    sput-object v0, Lorg/zeam/Utilities;->sCanvas:Landroid/graphics/Canvas;

    .line 37
    sget-object v0, Lorg/zeam/Utilities;->sCanvas:Landroid/graphics/Canvas;

    new-instance v1, Landroid/graphics/PaintFlagsDrawFilter;

    const/4 v2, 0x4

    const/4 v3, 0x2

    invoke-direct {v1, v2, v3}, Landroid/graphics/PaintFlagsDrawFilter;-><init>(II)V

    invoke-virtual {v0, v1}, Landroid/graphics/Canvas;->setDrawFilter(Landroid/graphics/DrawFilter;)V

    .line 26
    return-void
.end method

.method constructor <init>()V
    .locals 0

    .prologue
    .line 26
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static addOverlay(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 7
    .parameter "mutableBitmap"
    .parameter "overlay"

    .prologue
    .line 275
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v5

    .line 276
    .local v5, width:I
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v3

    .line 277
    .local v3, height:I
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;

    move-result-object v2

    .line 279
    .local v2, config:Landroid/graphics/Bitmap$Config;
    invoke-static {v5, v3, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 280
    .local v0, bitmapOverlay:Landroid/graphics/Bitmap;
    new-instance v4, Landroid/graphics/Paint;

    const/4 v6, 0x2

    invoke-direct {v4, v6}, Landroid/graphics/Paint;-><init>(I)V

    .line 281
    .local v4, paint:Landroid/graphics/Paint;
    new-instance v1, Landroid/graphics/Canvas;

    invoke-direct {v1, v0}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 283
    .local v1, canvas:Landroid/graphics/Canvas;
    new-instance v6, Landroid/graphics/Matrix;

    invoke-direct {v6}, Landroid/graphics/Matrix;-><init>()V

    invoke-virtual {v1, p0, v6, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V

    .line 284
    new-instance v6, Landroid/graphics/Matrix;

    invoke-direct {v6}, Landroid/graphics/Matrix;-><init>()V

    invoke-virtual {v1, p1, v6, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V

    .line 285
    return-object v0
.end method

.method static adjustIconOpacity(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
    .locals 3
    .parameter "iconDrawable"

    .prologue
    .line 255
    invoke-static {p0}, Lorg/zeam/Utilities;->getMutableBitmap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 256
    .local v0, iconBitmap:Landroid/graphics/Bitmap;
    new-instance v1, Lorg/zeam/FastBitmapDrawable;

    const/16 v2, 0x5f

    invoke-static {v0, v2}, Lorg/zeam/Utilities;->adjustOpacity(Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;

    move-result-object v2

    invoke-direct {v1, v2}, Lorg/zeam/FastBitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    return-object v1
.end method

.method private static adjustOpacity(Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;
    .locals 3
    .parameter "mutableBitmap"
    .parameter "opacity"

    .prologue
    .line 290
    new-instance v0, Landroid/graphics/Canvas;

    invoke-direct {v0}, Landroid/graphics/Canvas;-><init>()V

    .line 291
    .local v0, canvas:Landroid/graphics/Canvas;
    and-int/lit16 v2, p1, 0xff

    shl-int/lit8 v1, v2, 0x18

    .line 293
    .local v1, colour:I
    invoke-virtual {v0, p0}, Landroid/graphics/Canvas;->setBitmap(Landroid/graphics/Bitmap;)V

    .line 294
    sget-object v2, Landroid/graphics/PorterDuff$Mode;->DST_IN:Landroid/graphics/PorterDuff$Mode;

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Canvas;->drawColor(ILandroid/graphics/PorterDuff$Mode;)V

    .line 295
    return-object p0
.end method

.method static canUninstallApplication(Landroid/content/Context;Lorg/zeam/ApplicationItemInfo;)Z
    .locals 7
    .parameter "context"
    .parameter "applicationItemInfo"

    .prologue
    const/4 v6, 0x0

    .line 217
    invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v2

    .line 218
    .local v2, packageManager:Landroid/content/pm/PackageManager;
    iget-object v5, p1, Lorg/zeam/ApplicationItemInfo;->intent:Landroid/content/Intent;

    invoke-virtual {v2, v5, v6}, Landroid/content/pm/PackageManager;->resolveActivity(Landroid/content/Intent;I)Landroid/content/pm/ResolveInfo;

    move-result-object v3

    .line 219
    .local v3, resolveInfo:Landroid/content/pm/ResolveInfo;
    if-eqz v3, :cond_0

    .line 221
    iget-object v0, v3, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    .line 222
    .local v0, activityInfo:Landroid/content/pm/ActivityInfo;
    if-eqz v0, :cond_0

    .line 223
    iget-object v1, v0, Landroid/content/pm/ActivityInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    .line 224
    .local v1, applicationInfo:Landroid/content/pm/ApplicationInfo;
    if-eqz v1, :cond_0

    .line 225
    iget-object v4, v1, Landroid/content/pm/ApplicationInfo;->sourceDir:Ljava/lang/String;

    .line 226
    .local v4, sourceDir:Ljava/lang/String;
    if-eqz v4, :cond_0

    const-string v5, "/system"

    invoke-virtual {v4, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_0

    .line 227
    const/4 v5, 0x1

    .line 232
    .end local v0           #activityInfo:Landroid/content/pm/ActivityInfo;
    .end local v1           #applicationInfo:Landroid/content/pm/ApplicationInfo;
    .end local v4           #sourceDir:Ljava/lang/String;
    :goto_0
    return v5

    :cond_0
    move v5, v6

    goto :goto_0
.end method

.method static createBitmapThumbnail(Landroid/graphics/Bitmap;Landroid/content/Context;)Landroid/graphics/Bitmap;
    .locals 14
    .parameter "bitmap"
    .parameter "context"

    .prologue
    const/4 v12, 0x1

    const/4 v13, 0x0

    .line 117
    sget v10, Lorg/zeam/Utilities;->sIconWidth:I

    const/4 v11, -0x1

    if-ne v10, v11, :cond_0

    .line 118
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    .line 119
    .local v7, resources:Landroid/content/res/Resources;
    const/high16 v10, 0x105

    invoke-virtual {v7, v10}, Landroid/content/res/Resources;->getDimension(I)F

    move-result v10

    float-to-int v10, v10

    sput v10, Lorg/zeam/Utilities;->sIconHeight:I

    sput v10, Lorg/zeam/Utilities;->sIconWidth:I

    .line 121
    .end local v7           #resources:Landroid/content/res/Resources;
    :cond_0
    sget v9, Lorg/zeam/Utilities;->sIconWidth:I

    .line 122
    .local v9, width:I
    sget v4, Lorg/zeam/Utilities;->sIconHeight:I

    .line 124
    .local v4, height:I
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v1

    .line 125
    .local v1, bitmapWidth:I
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v0

    .line 127
    .local v0, bitmapHeight:I
    if-lez v9, :cond_7

    if-lez v4, :cond_7

    .line 128
    if-lt v9, v1, :cond_1

    if-ge v4, v0, :cond_5

    .line 130
    :cond_1
    int-to-float v10, v1

    int-to-float v11, v0

    div-float v6, v10, v11

    .line 131
    .local v6, ratio:F
    if-le v1, v0, :cond_3

    .line 132
    int-to-float v10, v9

    div-float/2addr v10, v6

    float-to-int v4, v10

    .line 136
    :cond_2
    :goto_0
    sget v10, Lorg/zeam/Utilities;->sIconWidth:I

    if-ne v9, v10, :cond_4

    sget v10, Lorg/zeam/Utilities;->sIconHeight:I

    if-ne v4, v10, :cond_4

    .line 137
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;

    move-result-object v10

    move-object v2, v10

    .line 139
    .local v2, c:Landroid/graphics/Bitmap$Config;
    :goto_1
    sget v10, Lorg/zeam/Utilities;->sIconWidth:I

    sget v11, Lorg/zeam/Utilities;->sIconHeight:I

    invoke-static {v10, v11, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v8

    .line 140
    .local v8, thumb:Landroid/graphics/Bitmap;
    sget-object v3, Lorg/zeam/Utilities;->sCanvas:Landroid/graphics/Canvas;

    .line 141
    .local v3, canvas:Landroid/graphics/Canvas;
    sget-object v5, Lorg/zeam/Utilities;->sPaint:Landroid/graphics/Paint;

    .line 143
    .local v5, paint:Landroid/graphics/Paint;
    invoke-virtual {v3, v8}, Landroid/graphics/Canvas;->setBitmap(Landroid/graphics/Bitmap;)V

    .line 144
    invoke-virtual {v5, v13}, Landroid/graphics/Paint;->setDither(Z)V

    .line 145
    invoke-virtual {v5, v12}, Landroid/graphics/Paint;->setFilterBitmap(Z)V

    .line 147
    sget-object v10, Lorg/zeam/Utilities;->sBounds:Landroid/graphics/Rect;

    sget v11, Lorg/zeam/Utilities;->sIconWidth:I

    sub-int/2addr v11, v9

    div-int/lit8 v11, v11, 0x2

    sget v12, Lorg/zeam/Utilities;->sIconHeight:I

    sub-int/2addr v12, v4

    div-int/lit8 v12, v12, 0x2

    invoke-virtual {v10, v11, v12, v9, v4}, Landroid/graphics/Rect;->set(IIII)V

    .line 148
    sget-object v10, Lorg/zeam/Utilities;->sOldBounds:Landroid/graphics/Rect;

    invoke-virtual {v10, v13, v13, v1, v0}, Landroid/graphics/Rect;->set(IIII)V

    .line 149
    sget-object v10, Lorg/zeam/Utilities;->sOldBounds:Landroid/graphics/Rect;

    sget-object v11, Lorg/zeam/Utilities;->sBounds:Landroid/graphics/Rect;

    invoke-virtual {v3, p0, v10, v11, v5}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    move-object v10, v8

    .line 167
    .end local v2           #c:Landroid/graphics/Bitmap$Config;
    .end local v3           #canvas:Landroid/graphics/Canvas;
    .end local v5           #paint:Landroid/graphics/Paint;
    .end local v6           #ratio:F
    .end local v8           #thumb:Landroid/graphics/Bitmap;
    :goto_2
    return-object v10

    .line 133
    .restart local v6       #ratio:F
    :cond_3
    if-le v0, v1, :cond_2

    .line 134
    int-to-float v10, v4

    mul-float/2addr v10, v6

    float-to-int v9, v10

    goto :goto_0

    .line 137
    :cond_4
    sget-object v10, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    move-object v2, v10

    goto :goto_1

    .line 152
    .end local v6           #ratio:F
    :cond_5
    if-lt v1, v9, :cond_6

    if-ge v0, v4, :cond_7

    .line 154
    :cond_6
    sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    .line 155
    .restart local v2       #c:Landroid/graphics/Bitmap$Config;
    sget v10, Lorg/zeam/Utilities;->sIconWidth:I

    sget v11, Lorg/zeam/Utilities;->sIconHeight:I

    invoke-static {v10, v11, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v8

    .line 156
    .restart local v8       #thumb:Landroid/graphics/Bitmap;
    sget-object v3, Lorg/zeam/Utilities;->sCanvas:Landroid/graphics/Canvas;

    .line 157
    .restart local v3       #canvas:Landroid/graphics/Canvas;
    sget-object v5, Lorg/zeam/Utilities;->sPaint:Landroid/graphics/Paint;

    .line 159
    .restart local v5       #paint:Landroid/graphics/Paint;
    invoke-virtual {v3, v8}, Landroid/graphics/Canvas;->setBitmap(Landroid/graphics/Bitmap;)V

    .line 160
    invoke-virtual {v5, v13}, Landroid/graphics/Paint;->setDither(Z)V

    .line 161
    invoke-virtual {v5, v12}, Landroid/graphics/Paint;->setFilterBitmap(Z)V

    .line 162
    sget v10, Lorg/zeam/Utilities;->sIconWidth:I

    sub-int/2addr v10, v1

    div-int/lit8 v10, v10, 0x2

    int-to-float v10, v10

    sget v11, Lorg/zeam/Utilities;->sIconHeight:I

    sub-int/2addr v11, v0

    div-int/lit8 v11, v11, 0x2

    int-to-float v11, v11

    invoke-virtual {v3, p0, v10, v11, v5}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    move-object v10, v8

    .line 163
    goto :goto_2

    .end local v2           #c:Landroid/graphics/Bitmap$Config;
    .end local v3           #canvas:Landroid/graphics/Canvas;
    .end local v5           #paint:Landroid/graphics/Paint;
    .end local v8           #thumb:Landroid/graphics/Bitmap;
    :cond_7
    move-object v10, p0

    .line 167
    goto :goto_2
.end method

.method static createIconThumbnail(Landroid/graphics/drawable/Drawable;Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
    .locals 8
    .parameter "icon"
    .parameter "context"

    .prologue
    .line 42
    sget v1, Lorg/zeam/Utilities;->sIconWidth:I

    const/4 v2, -0x1

    if-ne v1, v2, :cond_0

    .line 43
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    .line 44
    .local v1, resources:Landroid/content/res/Resources;
    const/high16 v2, 0x105

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimension(I)F

    move-result v1

    .end local v1           #resources:Landroid/content/res/Resources;
    float-to-int v1, v1

    sput v1, Lorg/zeam/Utilities;->sIconHeight:I

    sput v1, Lorg/zeam/Utilities;->sIconWidth:I

    .line 46
    :cond_0
    sget v5, Lorg/zeam/Utilities;->sIconWidth:I

    .line 47
    .local v5, width:I
    sget v3, Lorg/zeam/Utilities;->sIconHeight:I

    .line 49
    .local v3, height:I
    const/high16 v1, 0x3f80

    .line 50
    .local v1, scale:F
    instance-of v1, p0, Landroid/graphics/drawable/PaintDrawable;

    .end local v1           #scale:F
    if-eqz v1, :cond_3

    .line 52
    move-object v0, p0

    check-cast v0, Landroid/graphics/drawable/PaintDrawable;

    move-object p1, v0

    .line 53
    .local p1, painter:Landroid/graphics/drawable/PaintDrawable;
    invoke-virtual {p1, v5}, Landroid/graphics/drawable/PaintDrawable;->setIntrinsicWidth(I)V

    .line 54
    invoke-virtual {p1, v3}, Landroid/graphics/drawable/PaintDrawable;->setIntrinsicHeight(I)V

    .line 64
    .end local p1           #painter:Landroid/graphics/drawable/PaintDrawable;
    :cond_1
    :goto_0
    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v2

    .line 65
    .local v2, iconWidth:I
    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v1

    .line 67
    .local v1, iconHeight:I
    if-lez v5, :cond_7

    if-lez v3, :cond_7

    .line 68
    if-lt v5, v2, :cond_2

    if-ge v3, v1, :cond_6

    .line 70
    :cond_2
    int-to-float p1, v2

    int-to-float v4, v1

    div-float/2addr p1, v4

    .line 71
    .local p1, ratio:F
    if-le v2, v1, :cond_4

    .line 72
    int-to-float v1, v5

    div-float p1, v1, p1

    float-to-int p1, p1

    .end local v3           #height:I
    .local p1, height:I
    move v1, p1

    .end local p1           #height:I
    .local v1, height:I
    move v3, v5

    .line 76
    .end local v5           #width:I
    .local v3, width:I
    :goto_1
    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getOpacity()I

    move-result p1

    const/4 v2, -0x1

    if-eq p1, v2, :cond_5

    .line 77
    .end local v2           #iconWidth:I
    sget-object p1, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    .line 79
    .local p1, c:Landroid/graphics/Bitmap$Config;
    :goto_2
    sget v2, Lorg/zeam/Utilities;->sIconWidth:I

    sget v4, Lorg/zeam/Utilities;->sIconHeight:I

    invoke-static {v2, v4, p1}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v2

    .line 80
    .local v2, thumb:Landroid/graphics/Bitmap;
    sget-object p1, Lorg/zeam/Utilities;->sCanvas:Landroid/graphics/Canvas;

    .line 81
    .local p1, canvas:Landroid/graphics/Canvas;
    invoke-virtual {p1, v2}, Landroid/graphics/Canvas;->setBitmap(Landroid/graphics/Bitmap;)V

    .line 87
    sget-object v4, Lorg/zeam/Utilities;->sOldBounds:Landroid/graphics/Rect;

    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/graphics/Rect;->set(Landroid/graphics/Rect;)V

    .line 88
    sget v4, Lorg/zeam/Utilities;->sIconWidth:I

    sub-int/2addr v4, v3

    div-int/lit8 v4, v4, 0x2

    .line 89
    .local v4, x:I
    sget v5, Lorg/zeam/Utilities;->sIconHeight:I

    sub-int/2addr v5, v1

    div-int/lit8 v5, v5, 0x2

    .line 90
    .local v5, y:I
    add-int v6, v4, v3

    add-int v7, v5, v1

    invoke-virtual {p0, v4, v5, v6, v7}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 91
    invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 92
    sget-object p1, Lorg/zeam/Utilities;->sOldBounds:Landroid/graphics/Rect;

    .end local p1           #canvas:Landroid/graphics/Canvas;
    invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->setBounds(Landroid/graphics/Rect;)V

    .line 93
    new-instance p0, Lorg/zeam/FastBitmapDrawable;

    .end local p0
    invoke-direct {p0, v2}, Lorg/zeam/FastBitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    .restart local p0
    move p1, v1

    .end local v1           #height:I
    .local p1, height:I
    move v1, v3

    .line 112
    .end local v2           #thumb:Landroid/graphics/Bitmap;
    .end local v3           #width:I
    .end local v4           #x:I
    .end local v5           #y:I
    .local v1, width:I
    :goto_3
    return-object p0

    .line 56
    .end local v1           #width:I
    .local v3, height:I
    .local v5, width:I
    .local p1, context:Landroid/content/Context;
    :cond_3
    instance-of v1, p0, Landroid/graphics/drawable/BitmapDrawable;

    if-eqz v1, :cond_1

    .line 58
    move-object v0, p0

    check-cast v0, Landroid/graphics/drawable/BitmapDrawable;

    move-object v2, v0

    .line 59
    .local v2, bitmapDrawable:Landroid/graphics/drawable/BitmapDrawable;
    invoke-virtual {v2}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v1

    .line 60
    .local v1, bitmap:Landroid/graphics/Bitmap;
    invoke-virtual {v1}, Landroid/graphics/Bitmap;->getDensity()I

    move-result v1

    .end local v1           #bitmap:Landroid/graphics/Bitmap;
    if-nez v1, :cond_1

    .line 61
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .end local p1           #context:Landroid/content/Context;
    invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object p1

    invoke-virtual {v2, p1}, Landroid/graphics/drawable/BitmapDrawable;->setTargetDensity(Landroid/util/DisplayMetrics;)V

    goto :goto_0

    .line 73
    .local v1, iconHeight:I
    .local v2, iconWidth:I
    .local p1, ratio:F
    :cond_4
    if-le v1, v2, :cond_8

    .line 74
    int-to-float v1, v3

    mul-float/2addr p1, v1

    float-to-int p1, p1

    .end local v5           #width:I
    .local p1, width:I
    move v1, v3

    .end local v3           #height:I
    .local v1, height:I
    move v3, p1

    .end local p1           #width:I
    .local v3, width:I
    goto :goto_1

    .line 77
    .end local v2           #iconWidth:I
    :cond_5
    sget-object p1, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    goto :goto_2

    .line 95
    .local v1, iconHeight:I
    .restart local v2       #iconWidth:I
    .local v3, height:I
    .restart local v5       #width:I
    :cond_6
    if-ge v2, v5, :cond_7

    if-ge v1, v3, :cond_7

    .line 97
    sget-object p1, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    .line 98
    .local p1, c:Landroid/graphics/Bitmap$Config;
    sget v4, Lorg/zeam/Utilities;->sIconWidth:I

    sget v6, Lorg/zeam/Utilities;->sIconHeight:I

    invoke-static {v4, v6, p1}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v4

    .line 99
    .local v4, thumb:Landroid/graphics/Bitmap;
    sget-object p1, Lorg/zeam/Utilities;->sCanvas:Landroid/graphics/Canvas;

    .line 101
    .local p1, canvas:Landroid/graphics/Canvas;
    invoke-virtual {p1, v4}, Landroid/graphics/Canvas;->setBitmap(Landroid/graphics/Bitmap;)V

    .line 102
    sget-object v6, Lorg/zeam/Utilities;->sOldBounds:Landroid/graphics/Rect;

    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/graphics/Rect;->set(Landroid/graphics/Rect;)V

    .line 104
    sub-int v6, v5, v2

    div-int/lit8 v6, v6, 0x2

    .line 105
    .local v6, x:I
    sub-int v7, v3, v1

    div-int/lit8 v7, v7, 0x2

    .line 106
    .local v7, y:I
    add-int/2addr v2, v6

    add-int/2addr v1, v7

    invoke-virtual {p0, v6, v7, v2, v1}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 107
    .end local v1           #iconHeight:I
    .end local v2           #iconWidth:I
    invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 108
    sget-object p1, Lorg/zeam/Utilities;->sOldBounds:Landroid/graphics/Rect;

    .end local p1           #canvas:Landroid/graphics/Canvas;
    invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->setBounds(Landroid/graphics/Rect;)V

    .line 109
    new-instance p0, Lorg/zeam/FastBitmapDrawable;

    .end local p0
    invoke-direct {p0, v4}, Lorg/zeam/FastBitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    .restart local p0
    move p1, v3

    .end local v3           #height:I
    .local p1, height:I
    move v1, v5

    .end local v5           #width:I
    .local v1, width:I
    goto :goto_3

    .end local v4           #thumb:Landroid/graphics/Bitmap;
    .end local v6           #x:I
    .end local v7           #y:I
    .end local p1           #height:I
    .local v1, iconHeight:I
    .restart local v2       #iconWidth:I
    .restart local v3       #height:I
    .restart local v5       #width:I
    :cond_7
    move p1, v3

    .end local v3           #height:I
    .restart local p1       #height:I
    move v1, v5

    .end local v5           #width:I
    .local v1, width:I
    goto :goto_3

    .local v1, iconHeight:I
    .restart local v3       #height:I
    .restart local v5       #width:I
    .local p1, ratio:F
    :cond_8
    move v1, v3

    .end local v3           #height:I
    .local v1, height:I
    move v3, v5

    .end local v5           #width:I
    .local v3, width:I
    goto/16 :goto_1
.end method

.method static drawReflection(Landroid/graphics/drawable/Drawable;Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
    .locals 21
    .parameter "icon"
    .parameter "context"

    .prologue
    .line 172
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .line 173
    .local p1, resources:Landroid/content/res/Resources;
    const/high16 v5, 0x105

    move-object/from16 v0, p1

    move v1, v5

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimension(I)F

    move-result p1

    .end local p1           #resources:Landroid/content/res/Resources;
    move/from16 v0, p1

    float-to-int v0, v0

    move/from16 p1, v0

    sput p1, Lorg/zeam/Utilities;->sIconHeight:I

    sput p1, Lorg/zeam/Utilities;->sIconWidth:I

    .line 175
    const p1, 0x3fa66666

    .line 176
    .local p1, scale:F
    sget v8, Lorg/zeam/Utilities;->sIconWidth:I

    .line 177
    .local v8, width:I
    sget v19, Lorg/zeam/Utilities;->sIconHeight:I

    .line 179
    .local v19, height:I
    sget p1, Lorg/zeam/Utilities;->sIconHeight:I

    .end local p1           #scale:F
    move/from16 v0, p1

    int-to-float v0, v0

    move/from16 p1, v0

    sget v5, Lorg/zeam/Utilities;->sIconHeight:I

    int-to-float v5, v5

    const v6, 0x3fa66666

    mul-float/2addr v5, v6

    div-float v20, p1, v5

    .line 180
    .local v20, ratio:F
    sget-object p1, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    move v0, v8

    move/from16 v1, v19

    move-object/from16 v2, p1

    invoke-static {v0, v1, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 182
    .local v5, originalBitmap:Landroid/graphics/Bitmap;
    new-instance p1, Landroid/graphics/Canvas;

    invoke-direct/range {p1 .. p1}, Landroid/graphics/Canvas;-><init>()V

    .line 183
    .local p1, cv:Landroid/graphics/Canvas;
    move-object/from16 v0, p1

    move-object v1, v5

    invoke-virtual {v0, v1}, Landroid/graphics/Canvas;->setBitmap(Landroid/graphics/Bitmap;)V

    .line 184
    const/4 v6, 0x0

    const/4 v7, 0x0

    move-object/from16 v0, p0

    move v1, v6

    move v2, v7

    move v3, v8

    move/from16 v4, v19

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 185
    invoke-virtual/range {p0 .. p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 187
    new-instance v10, Landroid/graphics/Matrix;

    invoke-direct {v10}, Landroid/graphics/Matrix;-><init>()V

    .line 188
    .local v10, matrix:Landroid/graphics/Matrix;
    const/high16 p0, 0x3f80

    const/high16 p1, -0x4080

    move-object v0, v10

    move/from16 v1, p0

    move/from16 v2, p1

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Matrix;->preScale(FF)Z

    .line 191
    .end local p0
    .end local p1           #cv:Landroid/graphics/Canvas;
    const/4 v6, 0x0

    div-int/lit8 v7, v19, 0x2

    div-int/lit8 v9, v19, 0x2

    const/4 v11, 0x0

    .line 190
    invoke-static/range {v5 .. v11}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v7

    .line 194
    .local v7, reflectionImage:Landroid/graphics/Bitmap;
    move/from16 v0, v19

    int-to-float v0, v0

    move/from16 p0, v0

    const p1, 0x3fa66666

    mul-float p0, p0, p1

    move/from16 v0, p0

    float-to-int v0, v0

    move/from16 p0, v0

    sget-object p1, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    .line 193
    move v0, v8

    move/from16 v1, p0

    move-object/from16 v2, p1

    invoke-static {v0, v1, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object p0

    .line 196
    .local p0, bitmapWithReflection:Landroid/graphics/Bitmap;
    new-instance p1, Landroid/graphics/Canvas;

    move-object/from16 v0, p1

    move-object/from16 v1, p0

    invoke-direct {v0, v1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 197
    .local p1, canvas:Landroid/graphics/Canvas;
    const/4 v6, 0x0

    const/4 v9, 0x6

    sub-int v9, v19, v9

    int-to-float v9, v9

    const/4 v10, 0x0

    move-object/from16 v0, p1

    move-object v1, v7

    move v2, v6

    move v3, v9

    move-object v4, v10

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    .line 199
    .end local v10           #matrix:Landroid/graphics/Matrix;
    new-instance v6, Landroid/graphics/Paint;

    invoke-direct {v6}, Landroid/graphics/Paint;-><init>()V

    .line 200
    .local v6, paint:Landroid/graphics/Paint;
    new-instance v11, Landroid/graphics/LinearGradient;

    const/4 v12, 0x0

    invoke-virtual {v5}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v9

    int-to-float v13, v9

    .line 201
    const/4 v14, 0x0

    invoke-virtual/range {p0 .. p0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v9

    int-to-float v15, v9

    const v16, 0x70ffffff

    const v17, 0xffffff

    sget-object v18, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;

    .line 200
    invoke-direct/range {v11 .. v18}, Landroid/graphics/LinearGradient;-><init>(FFFFIILandroid/graphics/Shader$TileMode;)V

    .line 203
    .local v11, shader:Landroid/graphics/LinearGradient;
    invoke-virtual {v6, v11}, Landroid/graphics/Paint;->setShader(Landroid/graphics/Shader;)Landroid/graphics/Shader;

    .line 204
    new-instance v9, Landroid/graphics/PorterDuffXfermode;

    sget-object v10, Landroid/graphics/PorterDuff$Mode;->DST_IN:Landroid/graphics/PorterDuff$Mode;

    invoke-direct {v9, v10}, Landroid/graphics/PorterDuffXfermode;-><init>(Landroid/graphics/PorterDuff$Mode;)V

    invoke-virtual {v6, v9}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    .line 205
    const/4 v13, 0x0

    const/4 v9, 0x6

    sub-int v9, v19, v9

    int-to-float v14, v9

    int-to-float v15, v8

    invoke-virtual/range {p0 .. p0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v8

    .end local v8           #width:I
    move v0, v8

    int-to-float v0, v0

    move/from16 v16, v0

    move-object/from16 v12, p1

    move-object/from16 v17, v6

    invoke-virtual/range {v12 .. v17}, Landroid/graphics/Canvas;->drawRect(FFFFLandroid/graphics/Paint;)V

    .line 206
    const/4 v6, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    move-object/from16 v0, p1

    move-object v1, v5

    move v2, v6

    move v3, v8

    move-object v4, v9

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    .line 208
    .end local v6           #paint:Landroid/graphics/Paint;
    invoke-virtual {v5}, Landroid/graphics/Bitmap;->recycle()V

    .line 209
    invoke-virtual {v7}, Landroid/graphics/Bitmap;->recycle()V

    .line 211
    new-instance p1, Lorg/zeam/FastBitmapDrawable;

    .line 212
    .end local p1           #canvas:Landroid/graphics/Canvas;
    sget v5, Lorg/zeam/Utilities;->sIconWidth:I

    .end local v5           #originalBitmap:Landroid/graphics/Bitmap;
    int-to-float v5, v5

    mul-float v5, v5, v20

    invoke-static {v5}, Ljava/lang/Math;->round(F)I

    move-result v5

    sget v6, Lorg/zeam/Utilities;->sIconHeight:I

    const/4 v7, 0x1

    .line 211
    move-object/from16 v0, p0

    move v1, v5

    move v2, v6

    move v3, v7

    invoke-static {v0, v1, v2, v3}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

    .end local v7           #reflectionImage:Landroid/graphics/Bitmap;
    move-result-object p0

    .end local p0           #bitmapWithReflection:Landroid/graphics/Bitmap;
    move-object/from16 v0, p1

    move-object/from16 v1, p0

    invoke-direct {v0, v1}, Lorg/zeam/FastBitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    return-object p1
.end method

.method private static getMutableBitmap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Bitmap;
    .locals 3
    .parameter "iconDrawable"

    .prologue
    .line 261
    const/4 v0, 0x0

    .line 262
    .local v0, bitmap:Landroid/graphics/Bitmap;
    instance-of v1, p0, Landroid/graphics/drawable/BitmapDrawable;

    if-eqz v1, :cond_1

    .line 263
    check-cast p0, Landroid/graphics/drawable/BitmapDrawable;

    .end local p0
    invoke-virtual {p0}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    .line 267
    :cond_0
    :goto_0
    if-eqz v0, :cond_2

    .line 268
    sget-object v1, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Bitmap;->copy(Landroid/graphics/Bitmap$Config;Z)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 270
    :goto_1
    return-object v1

    .line 264
    .restart local p0
    :cond_1
    instance-of v1, p0, Lorg/zeam/FastBitmapDrawable;

    if-eqz v1, :cond_0

    .line 265
    check-cast p0, Lorg/zeam/FastBitmapDrawable;

    .end local p0
    invoke-virtual {p0}, Lorg/zeam/FastBitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    goto :goto_0

    .line 270
    :cond_2
    const/4 v1, 0x0

    goto :goto_1
.end method

.method static overlayUninstallIcon(Landroid/content/Context;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
    .locals 5
    .parameter "context"
    .parameter "iconDrawable"

    .prologue
    .line 237
    if-nez p1, :cond_0

    .line 238
    const/4 v4, 0x0

    .line 249
    .end local p0
    :goto_0
    return-object v4

    .line 240
    .restart local p0
    :cond_0
    invoke-static {p1}, Lorg/zeam/Utilities;->getMutableBitmap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 241
    .local v1, iconBitmap:Landroid/graphics/Bitmap;
    if-nez v1, :cond_1

    move-object v4, p1

    .line 242
    goto :goto_0

    .line 244
    :cond_1
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    .line 246
    .local v3, resources:Landroid/content/res/Resources;
    const v4, 0x7f020018

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object p0

    .line 245
    .end local p0
    check-cast p0, Landroid/graphics/drawable/BitmapDrawable;

    .line 246
    invoke-virtual {p0}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v2

    .line 248
    .local v2, overlayBitmap:Landroid/graphics/Bitmap;
    invoke-static {v1, v2}, Lorg/zeam/Utilities;->addOverlay(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 249
    .local v0, finalBitmap:Landroid/graphics/Bitmap;
    new-instance v4, Lorg/zeam/FastBitmapDrawable;

    invoke-direct {v4, v0}, Lorg/zeam/FastBitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    goto :goto_0
.end method
